package com.myapp.struts.menu;

import java.util.ArrayList;

public class GBEveningXML {

    private static GBEveningXML gbEveningXMLObj;
    ArrayList<FoodItems> gbEveningXMLArray = new ArrayList<FoodItems>();

    public static synchronized GBEveningXML getSingletonObject() {
        if (gbEveningXMLObj == null) {
            gbEveningXMLObj = new GBEveningXML();
        }
        return gbEveningXMLObj;
    }

    public Object clone() throws CloneNotSupportedException {
        throw new CloneNotSupportedException();
    }

    public String getGBEveningXML(String fileLoc) {
        String fileName = "";

        MenuRead menuReadObj = new MenuRead();
        gbEveningXMLArray = menuReadObj.ReadMenu(Constants.GREAT_BRITAN);
        
        MenuGenerate menuGenerateObj = new MenuGenerate();
        gbEveningXMLArray = menuGenerateObj.GenerateMenu(gbEveningXMLArray, Constants.EVENING_ONLY);

        MenuFormat menuFormatObj = new MenuFormat();
        fileName = menuFormatObj.FormatMenu(gbEveningXMLArray, Constants.XML, fileLoc);
        return fileName;

    }
}
